CREATE TABLE [dbo].[tb_HistoriaClinica]
(
[IdHistoriaClinica] [int] NOT NULL IDENTITY(1, 1),
[Agente] [int] NOT NULL,
[GrupoYFactorSanguineo] [int] NULL,
[EstadoGralSalud] [int] NOT NULL,
[Apto] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[FechaApto] [datetime] NULL,
[FechaVencimiento] [datetime] NULL,
[AlcanceApto] [int] NOT NULL,
[TieneAlteracion] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DescripcionAlteracion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CongenitaOAdquirida] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DisminucionApto] [int] NULL,
[Incapacidad] [int] NULL,
[Observaciones] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_HistoriaClinica] ADD CONSTRAINT [PK_tb_HistoriaClinica] PRIMARY KEY NONCLUSTERED  ([IdHistoriaClinica]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_HistoriaClinica] WITH NOCHECK ADD CONSTRAINT [FK_tb_HistoriaClinica_tb_Agentes] FOREIGN KEY ([Agente]) REFERENCES [dbo].[tb_Agentes] ([idAgente])
GO
ALTER TABLE [dbo].[tb_HistoriaClinica] ADD CONSTRAINT [FK_tb_HistoriaClinica_tb_AlcanceDeAptitud] FOREIGN KEY ([AlcanceApto]) REFERENCES [dbo].[tb_AlcanceDeAptitud] ([idAlcance])
GO
ALTER TABLE [dbo].[tb_HistoriaClinica] ADD CONSTRAINT [FK_tb_HistoriaClinica_tb_EstadosDeSaludLaboral] FOREIGN KEY ([EstadoGralSalud]) REFERENCES [dbo].[tb_EstadosDeSaludLaboral] ([idEstadoSalud])
GO
ALTER TABLE [dbo].[tb_HistoriaClinica] ADD CONSTRAINT [FK_tb_HistoriaClinica_tb_TiposDeSangreYFactor] FOREIGN KEY ([GrupoYFactorSanguineo]) REFERENCES [dbo].[tb_TiposDeSangreYFactor] ([idTipoDeSangre])
GO
